package com.imoresoft.magic.action;

import com.imoresoft.magic.property.ProsReader;

public class AdminAction extends BaseAction {

	private static final long serialVersionUID = -6510462430030627740L;

	private String adminName;

	private String adminPassword;

	private String result;

	public String getResult() {
		return result;
	}

	public void setResult(String result) {
		this.result = result;
	}

	public AdminAction() {
	}

	public String getAdminName() {
		return adminName;
	}

	public void setAdminName(String adminName) {
		this.adminName = adminName;
	}

	public String getAdminPassword() {
		return adminPassword;
	}

	public void setAdminPassword(String adminPassword) {
		this.adminPassword = adminPassword;
	}

	public String adminLogin() {
		String adminName = ProsReader.getString("ADMIN_NAME");
		String adminPassword = ProsReader.getString("ADMIN_PASSWORD");
		if (adminName.equalsIgnoreCase(this.getAdminName())
				&& adminPassword.equalsIgnoreCase(this.getAdminPassword())) {
			return SUCCESS;
		}
		String msg = "用户名或密码错误";
		this.setResult(msg);
		return INPUT;
	}
}
